﻿<html>
<head>
  <title>Stopwatch Settings</title>
  <style type="text/css">
    body { margin: 0; width: 278px; height: 200px; }
    img { float: left; margin-right: 15px; }
    div { margin-bottom: 15px; }
  </style>
  <script type="text/javascript">
    function load()
    {
      count_down = parseInt(System.Gadget.Settings.readString("interval"));
      if (isNaN(count_down)) count_down = 30000;
      selectByValue(count_down);
      System.Gadget.onSettingsClosing = onClosing;
    }

    function selectByValue(item)
    {
      switch (item)
      {
        case 1000: increment.selectedIndex = 0; break;
        case 5000: increment.selectedIndex = 1; break;
        case 10000: increment.selectedIndex = 2; break;
        case 30000: increment.selectedIndex = 3; break;
        case 60000: increment.selectedIndex = 4; break;
        case 300000: increment.selectedIndex = 5; break;
        case 600000: increment.selectedIndex = 6; break;
        case 1800000: increment.selectedIndex = 7; break;
        case 3600000: increment.selectedIndex = 8; break;
        default: increment.selectedIndex = 1;
      }
    }

    function onClosing(event)
    {
      if (event.closeAction == event.Action.commit)
      {
        System.Gadget.Settings.write("interval", increment.value)
        event.cancel = false;
      }
    }    
  </script>
</head>
<body onload="load()">
  <div>
    Count down start increment:
    <select id="increment">
      <option value="1000">1 second</option>
      <option value="5000">5 seconds</option>
      <option value="10000">10 seconds</option>
      <option value="30000">30 seconds</option>
      <option value="60000">1 minute</option>
      <option value="300000">5 minutes</option>
      <option value="600000">10 minutes</option>
      <option value="1800000">30 minutes</option>
      <option value="3600000">1 hour</option>
    </select>
  </div>
  <div>
    &bull; Click anywhere on the gadget to to start/stop<br />
    &bull; Double-click to reset to zero<br />
    &bull; Shift-click increments count down start<br />
    &bull; Shift-Ctrl click decrements count down start<br />
  </div>
  <div>
    <img src="logo.png" alt="" />For updates and other exciting programs go to <a href="http://blueonionsoftware.com"
      onfocus="this.hideFocus=true;">http://blueonionsoftware.com</a>
  </div>
</body>
</html>
